main(a,b,c,d,l){for(gets(&a);~scanf("%d%d",&a,&b);puts(l?"Unlimited":"Limited")){c=a;d=b;while(c){a=d%c;d=c;c=a;}b/=d;for(l=0,a=2;a<=b&&!l;++a){if(!(b%a)){l|=!(a==2)&&!(a==5);b/=a;a=1;}}}}
